<HTML><HEAD><TITLE>at(+Stream, -Pointer)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Stream I/O</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>at(+Stream, -Pointer)</H1>
Succeeds if Position is the position of the stream Stream.


<DL>
<DT><EM>Stream</EM></DT>
<DD>Integer (stream number) or Atom (reserved or user-defined symbolic stream name).
</DD>
<DT><EM>Pointer</EM></DT>
<DD>Integer or variable.
</DD>
</DL>
<H2>Description</H2>
   Unifies Position with the position of the given Stream, which is
   defined as follows:
<UL><LI>
   For file streams, Position is the position in the file (the offset in
   bytes from the beginning of the file) where the next read/write operation
   will occur.
</LI><LI>
   For tty read streams, Position is the number of bytes already read from
   the tty. For tty write streams, Position is the number of bytes already
   written to the tty.
</LI><LI>
   For pipe read streams, Position is the number of bytes already read from
   the pipe. For pipe write streams, Position is the number of bytes already
   written to the pipe.
</LI><LI>
   For socket streams, Position is the number of bytes already read from
   the socket.
</LI><LI>
   For string streams, Position is the position in the string (the offset in
   bytes from the beginning of the string) where the next read/write operation
   will occur.
</LI><LI>
   For queue read streams, Position is always 0. For queue write and queue
   update streams, Position is the number of unread bytes in the queue.
</LI><LI>
   For the null stream, Position is always 0.
</LI></UL>

   Stream can be a symbolic stream name or a physical stream number.

<H3>Modes and Determinism</H3><UL>
<LI>at(+, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Stream is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Pointer is instantiated to a non-integer.
<DT><EM>(5) type error </EM>
<DD>Stream is instantiated to neither an integer nor an atom.
<DT><EM>(192) illegal stream mode </EM>
<DD>Stream is an illegal stream mode.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      [eclipse]: open(file1,write,s), at(s, P1),
      &gt; write(s, 1234567890), at(s, P2), close(s).
      P1 = 0
      P2 = 10
      yes.
      [eclipse]: open(file1,update,s), at(s, P1), read(s, T),
      &gt; at(s, P2), close(s).
      P1 = 0
      T = 1234567890
      P2 = 10
      yes.

Error:
      at(Stream, 4).      (Error 4).
      at("3", Position).   (Error 5).
      at(7, 4.3).         (Error 5).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/iostream/at_eof-1.html">at_eof / 1</A>, <A HREF="../../kernel/iostream/seek-2.html">seek / 2</A>
</BODY></HTML>
